package org.csu.service.imp;

import com.sun.org.apache.xpath.internal.operations.Bool;
import org.csu.dao.UserDao;
import org.csu.pojo.User;
import org.csu.service.UserRegisterService;
import org.springframework.stereotype.Service;

@Service(value="userRegisterService")
public class UserRegisterServiceImp implements UserRegisterService {
    private UserDao userDao;
    @Override
    public String register(User user,String confirmPassword) {
        //TODO 用户注册
        System.out.println("根据用户名："+user.getName()+"/密码："+confirmPassword+"/来注册用户");
        return "注册成功";
    }
    public  String vertifyEmail(String token) {
        //TODO 验证邮箱
        System.out.println("根据用户邮箱来验证用户");
        return "验证成功";
    }
    public Boolean checkEmailExists(String email) {
        //TODO 检测邮箱是否存在
        System.out.println("根据用户邮箱来查询用户");
        return true;
    }
    public String validateRegistration(User user){
        //TODO 验证用户注册信息
        System.out.println("根据用户名："+user.getName()+"/密码："+user.getPassword()+"/来验证用户");
            return "验证成功";
    }

    public Boolean sendVerificationEmail(User user) {
        //TODO 检测用户邮箱来发送邮件
        System.out.println("检测用户邮箱来发送邮件是否成功");
        return true;
    }
    public Boolean activateUser(String token){
        //TODO 检测用户激活是否成功
        System.out.println("检测用户激活是否成功");
        return true;
    }

    public String encryptPassword(String rawPassword){
        //TODO 密码加密
        System.out.println("返回密码字符串为"+rawPassword);
        return "密码";
    }

}
